package org.jsola.hr.vo;

import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jsola.core.vo.BaseVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wxz
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "【每日考勤时段】展示对象")
@Data
public class AttendDailyPeriodVO extends BaseVO {

    private static final long serialVersionUID = 1L;

    /** 时段 */
    private String period;

    /** 每日考勤日期 */
    private List<AttendDailyDateVO> dailyDateList;


    public static void main(String[] args) {

        List<AttendDailyDateVO> dailyDateList = new ArrayList<>();

        AttendDailyDateVO date1 = new AttendDailyDateVO();

        date1.setYearly("2020");
        date1.setMonthly("01");
        date1.setDaily("01");
        List<AttendDailyStatusVO> dailyStatusList = new ArrayList<>();

        AttendDailyStatusVO status1 = new AttendDailyStatusVO();
        status1.setTimePoint("09:00");
        status1.setWorkId("xxxx");
        status1.setWorkStatus(1);
        status1.setWorkStatusStr("正常");
        dailyStatusList.add(status1);

        AttendDailyStatusVO status2 = new AttendDailyStatusVO();
        status2.setTimePoint("10:00");
        status2.setWorkId("xxxx");
        status2.setWorkStatus(1);
        status2.setWorkStatusStr("正常");
        dailyStatusList.add(status2);

        date1.setDailyStatusList(dailyStatusList);

        dailyDateList.add(date1);

        AttendDailyDateVO date2 = new AttendDailyDateVO();

        date2.setYearly("2020");
        date2.setMonthly("01");
        date2.setDaily("02");
        List<AttendDailyStatusVO> dailyStatusList2 = new ArrayList<>();

        AttendDailyStatusVO status11 = new AttendDailyStatusVO();
        status11.setTimePoint("09:00");
        status11.setWorkId("xxxx");
        status11.setWorkStatus(1);
        status11.setWorkStatusStr("正常");
        dailyStatusList2.add(status11);

        AttendDailyStatusVO status22 = new AttendDailyStatusVO();
        status22.setTimePoint("10:00");
        status22.setWorkId("xxxx");
        status22.setWorkStatus(1);
        status22.setWorkStatusStr("正常");
        dailyStatusList2.add(status22);

        date2.setDailyStatusList(dailyStatusList2);

        dailyDateList.add(date2);


        AttendDailyPeriodVO attendDailyPeriodVO = new AttendDailyPeriodVO();

        attendDailyPeriodVO.setPeriod("09:00-10:00");
        attendDailyPeriodVO.setDailyDateList(dailyDateList);

        System.out.println(JSON.toJSONString(attendDailyPeriodVO));

    }

}
